﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Planer.Model.Validators.Base
{
    public class DescriptionValidator : Validator<string>
    {
        public static readonly int MAX_DESCRIPTION_LENGTH = 300;

        public override void Validate(string Description)
        {
            if (Description == null) throw new ArgumentNullException("Description", NULL_ARGUMENT_MESSAGE);

            if (Description.Length > MAX_DESCRIPTION_LENGTH)
            {
                this.status = OperationStatusType.ERROR;
                this.errors.Add("Длина описания превышает допустимое число символов (" + MAX_DESCRIPTION_LENGTH + ")");
            }
        }
    }
}
